"""
作者：元明
日期：2023年11月09日
"""

"""
作业要求
编写一个Python程序，对一个简单的故事进行如下操作：

统计故事中的单词数量。
查找主人公的名字在故事中的位置。
将主人公的名字替换为你的名字。
将故事改写为大写和小写形式。

"""

story = """ Once upon a time, in a lush green forest, there lived a brave little fox named Felix. Felix was known for his courage and his willingness to help others. He had many animal friends in the forest, including a wise old owl named Oliver, a playful squirrel named Sammy, and a kind-hearted deer named Daisy.

One day, a group of hunters entered the forest with the intention of capturing the animals and selling them. The news spread quickly, and the animals were filled with fear. They knew they had to come up with a plan to protect themselves and their home.

Felix called for a meeting with his friends and shared the news. They all agreed that they needed to work together to outsmart the hunters. Oliver suggested using his wisdom to guide them, Sammy offered to gather information about the hunters' whereabouts, and Daisy promised to alert the others if she sensed any danger.

With their plan in place, the animals set out to execute it. Felix and Sammy carefully observed the hunters' movements and relayed the information to Oliver and Daisy. Oliver used his wisdom to strategize and come up with a plan to lead the hunters away from the animals' hiding spots.

As the days passed, the animals became more skilled at evading the hunters. They used their knowledge of the forest to their advantage, leading the hunters on wild goose chases and confusing them with their clever tactics. The hunters soon grew frustrated and decided to leave the forest, realizing that capturing the animals was an impossible task.

The animals celebrated their victory and thanked Felix for his bravery and leadership. They realized that by working together and using their individual strengths, they were able to overcome any challenge. The forest was once again a safe haven for all its inhabitants.

From that day forward, Felix and his friends continued to protect the forest and its creatures. They became a symbol of unity and courage, inspiring other animals to stand up for what they believed in. The story of the brave little fox and his loyal friends spread far and wide, reminding everyone of the power of friendship and the importance of protecting our natural world."""

count_story = len(story)
print(count_story)
zhurengong = story.find("Felix")
print(zhurengong)
print(story.replace("Felix", "lele"))
print(story.upper())
print(story.lower())

"""
编写一个 Python 程序，用户输入一个分数，程序将根据分数判断并输出相应的等级。
分数在 90 分及以上为 A 等级，60 -89 分为 B 等级，否则为 C 等级。

"""

score = int(input("请输入一个分数:"))
if score >= 0 and score <= 100:
    if score >= 90:
        print("A")
    elif score >= 60 and score <= 89:
        print("B")
    else:
        print("C")
else:
    print("输入的分数不合法")

"""
编写一个简单的Python程序，实现一个简易的计算器。
用户可以输入两个数字和一个运算符（+、-、*、/），程序将根据运算符执行相应的计算操作，并输出结果。
"""
a = int(input("计算器输入第一个数字："))
b = int(input("计算器输入第二个数字："))
yusuan_fuhao = input("输入计算符号")

if yusuan_fuhao == "+":
    print(a + b)
elif yusuan_fuhao == "-":
    print(a - b)
elif yusuan_fuhao == "*":
    print(a * b)
elif yusuan_fuhao == "/":
    print(a / b)
